def setup_function():
    print("开始")
def teardown_function():
    print("结束")

import requests
import pytest

class Testlx():
    token=None
    id=""
    addrid=None
    def setup_class(self):
        print("开始")
    def teardown_class(self):
        print("结束")

    def test_dl(self):
        url="http://10.59.9.12:7001/api/public/login"
        headers=None
        data={"username":"13811033962","password":"123456"}
        r=requests.post(url=url,json=data)
        print(r.json())
        Testlx.token=r.json()['data']['token']

    def test_duihuan(self):
        url="http://10.59.9.12:7001/api/point?page=1&type=0&sort=1"
        headers=None
        data=None
        r=requests.get(url=url)
        print(r.json())

    def test_xiangqing(self):
        url="http://10.59.9.12:7001/api/point/view?id=19"
        headers=None
        data=None
        r=requests.get(url=url)
        print(r.json())

    def test_querendingdan(self):
        url="http://10.59.9.12:7001/api/order/confirm?id=19&type=point&sku_id=&num=1&shipping_type=1"
        headers={"auth-token":"Bearer"+Testlx.token}
        data=None
        r=requests.get(url=url,headers=headers)
        print(r.json())

    def test_zhifu(self):
        url="http://10.59.9.12:7001/api/order/create"
        headers={"auth-token":"Bearer"+Testlx.token}
        data={"id":"19","type":"point","address_id":876,"store_id":1,"shipping_type":1,"bonus_id":"0","payment":"balance","remarks":"","source":1,"url":"http://10.59.9.12:7001/wap/pages/cart/confirm?id=19&sku_id=&num=1&type=point","sku_id":"","num":"1"}
        r=requests.post(url=url,headers=headers,json=data)
        print(r.json())



